import QtQuick 2.0
import QtWebEngine 1.8

Rectangle {

    id:webControl
    property string webUrl
    property alias myWeb: myWeb
    //property int name: value

    WebEngineView {
        id :myWeb
        anchors.fill: parent
        url:webUrl
        settings.pluginsEnabled:true
        settings.javascriptEnabled: true
        WebEngineAction.trigger: canGoBack

        onUrlChanged: {
            console.log("url 1: " +url)
            wUrl = url
        }

        //鼠标点击响应
        onNewViewRequested: {

            url = request.requestedUrl
            console.log("url 2: " +url)
        }

        //滑过即可响应
//        onLinkHovered: {
//           url = hoveredUrl
//           console.log("url 3: " +url)
//        }

        //WebDataComponent
//        MouseArea {

//              anchors.fill: parent
//              drag.target: parent.data

//         }


    }
}

/*##^##
Designer {
    D{i:0;autoSize:true;height:480;width:640}
}
##^##*/
